// A simple class using friend function
// Date 21:36 31/10/2016
// By Ben a.k.a DreamVB

#include <iostream>

using namespace std;
using std::cout;
using std::endl;

class CBox{
	public:
		double m_length = 0;
		double m_width = 0;
		double m_height = 0;

		//Default constructor
		CBox(){
			m_width = m_height = m_length = 2.5;
		}

		CBox(double length, double width, double height){
			m_length = length;
			m_width = width;
			m_height = height;
		}

		double Volume(){
			return m_length*m_width*m_height;
		}

		friend double boxSurface(const CBox& thebox);
};

int main(int argc, char *argv[]){
	CBox box(2.3, 2.3, 6.3);

	cout << "Length  : " << box.m_length << endl;
	cout << "Width   : " << box.m_width << endl;
	cout << "Height  : " << box.m_height << endl;
	cout << "Volume  : " << box.Volume() << endl;
	cout << "Surface : " << boxSurface(box) << endl;

	system("pause");
	return 0;
}

double boxSurface(const CBox& thebox){
	return 2.0 * (thebox.m_length * thebox.m_width +
		thebox.m_length * thebox.m_length +
		thebox.m_height * thebox.m_width);
}